package cn.zhaozhiqi.remote.api;

import cn.zhaozhiqi.constants.Constants;
import cn.zhaozhiqi.remote.dto.*;
import cn.zhaozhiqi.remote.fallback.RuleFeignClientFallbackFactory;
import cn.zhaozhiqi.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = Constants.Remote.SERVICE_RULE,fallbackFactory = RuleFeignClientFallbackFactory.class)
public interface IRuleFeignClient {
    /**
     * 计算下单后的预估费用接口
     * @param dto
     * @return
     */
    @PostMapping("/rule/orderComputed")
    JSONResult<ExpectsOrderDto> orderComputed(@RequestBody RuleComputedDto dto);

    /**
     *
     * @param dto
     * @return
     */
    @PostMapping("/rule/waitTimeMoneyComputed")
    JSONResult<WaitTimeDetailDto> waitTimeConputed(@RequestBody WaitTimeComputedDto dto);


    /**
     * 传入司机今日的投诉和主动取消订单的数量,计算分账规则，返回分账比例
     * @param dto
     * @return
     */
    @PostMapping("/rule/driverProfitsharing")
    JSONResult<OrderProfitsharingResultDto> getOrderProfitsharingDto(@RequestBody OrderProfitsharingDto dto);


}
